#include <iostream>


//单例模式-懒汉的更加优雅的实现方案--C++11
class Singleton
{
private:
    int _data;
private:
    Singleton() :_data(99)
    {
        std::cout << "单列模式" << std::endl;
    };
    ~Singleton(){};
    Singleton(const Singleton&) = delete;
public:
    static Singleton& getInstance()
    {
        static Singleton _eton;
        return _eton;
    }

    int getData()
    {
        return _data;
    }
};


//相当于递归结束的条件
void xprint(){
    std::cout << std::endl;
}
template<class T, class ...Args>
void xprint(const T& t, Args&& ...args)
{
    std::cout << t << " ";
    if(sizeof ...(args) > 0)
    {
        xprint(std::forward<Args>(args)...);//完美转发保持args的完本属性
    }
    else
    {
        xprint();
    }

}
int main()
{
    // xprint("abcd");
    // xprint("aaa", 123);
    // xprint(4444, 9.00);

    std::cout << Singleton::getInstance().getData() << std::endl;
    return 0;
}